package com.aistar.pojo.pojoOV;

import com.aistar.pojo.Flow;
import com.aistar.pojo.ProOrder;
import com.aistar.pojo.Product;
import com.aistar.pojo.Traveller;

import java.util.List;
import java.util.Objects;

public class OrderDetailOV {

    /**
     * 订单流水
     */
    private Flow flow;

    /**
     * 订单
     */
    private ProOrder order;

    /**
     * 常用旅客列表
     */
    private List<Traveller> travellers;

    /**
     * 产品
     */
    private Product product;

    /**
     * 无参构造函数
     */
    public OrderDetailOV() {
    }

    /**
     * 有参构造函数
     */
    public OrderDetailOV(Flow flow, ProOrder order, List<Traveller> travellers, Product product) {
        this.flow = flow;
        this.order = order;
        this.travellers = travellers;
        this.product = product;
    }

    /**
     * get、set方法
     */
    public Flow getFlow() {
        return flow;
    }

    public void setFlow(Flow flow) {
        this.flow = flow;
    }

    public ProOrder getOrder() {
        return order;
    }

    public void setOrder(ProOrder order) {
        this.order = order;
    }

    public List<Traveller> getTravellers() {
        return travellers;
    }

    public void setTravellers(List<Traveller> travellers) {
        this.travellers = travellers;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    /**
     * toString
     */
    @Override
    public String toString() {
        return "OrderDetailOV{" +
                "flow=" + flow +
                ", order=" + order +
                ", travellers=" + travellers +
                ", product=" + product +
                '}';
    }

    /**
     * hash、equals
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderDetailOV that = (OrderDetailOV) o;
        return Objects.equals(flow, that.flow) &&
                Objects.equals(order, that.order) &&
                Objects.equals(travellers, that.travellers) &&
                Objects.equals(product, that.product);
    }

    @Override
    public int hashCode() {
        return Objects.hash(flow, order, travellers, product);
    }
}
